<template>
  <div>
    <p>{{inputdata}}</p>
    <input type="text" v-model="inputdata" @keyup[haha]="press">
    <div class="btn" @click="press">button</div>
  </div>
</template>

<script>
export default{
  name: 'keyCode',
  data () {
    return {
      inputdata: ''
    }
  },
  methods: {
    press () {
      alert(111)
    }
  }
}
</script>

<style scoped>
p{
  font-size: 18px;
  background: white;
  color: black;
}
.btn{
  width: 100px;
  height: 40px;
  border-radius: 5px;
  background: blue;
  color: white;
  font-size: 16px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
}
</style>
